﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;

public class RotationPlatform4 : MonoBehaviour {

    public float duration = 0.8f;
    public float delay = 1f;

    public float rotation = 180f;

    private void Start() {
        OnComplete();
    }

    void OnComplete() {
        transform.DOKill();
        transform.DOLocalRotateQuaternion(Quaternion.Euler(0, 0, rotation) * transform.localRotation, duration)
                 .SetDelay(delay)
                 .OnComplete(OnComplete)
                 .PlayForward();
    }
}
